import Vue from "vue";
import VueRouter from "vue-router";
import Login from "@/views/login";
import Register from "@/views/register";
import Detail from "@/views/detail";
import Layout from "@/views/layout";
import Find from "@/views/find";
import Article from "@/views/article";
import Collect from "@/views/collect";
import User from "@/views/user";
import Sc from "@/views/sc";
import Rent from "@/views/rent";
import Go from "@/views/go";
import City from "@/views/city";
import Ee from "@/views/ee";
import Map from "@/views/map";
Vue.use(VueRouter);

const router = new VueRouter({
  routes: [
    { path: "/login", component: Login },
    { path: "/register", component: Register },
    { path: "/detail/:id", component: Detail },
    {
      path: "/go",
      component: Go,
    },
    {
      path: "/ee",
      component: Ee,
    },
    {
      path: "/map",
      component: Map,
    },
    {
      path: "/city",
      component: City,
    },
    {
      path: "/",
      component: Layout,
      redirect: "/article",
      children: [
        {
          path: "/article",
          component: Article,
        },
        {
          path: "/find",
          component: Find,
        },
        {
          path: "/collect",
          component: Collect,
        },
        {
          path: "/user",
          component: User,
        },
        {
          path: "/sc",
          component: Sc,
        },
        {
          path: "/rent",
          component: Rent,
        },
      ],
    },
  ],
});

const whiteList = ["/login"];

export default router;
